using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MecRobGest.GUI
{
    public partial class GUIOFStats : Form
    {
        public GUIOFStats()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //Informe de todas las OF
            Reports.OFResumen OFResumen1 = new Reports.OFResumen();
            OFResumen1.SetParameterValue("DataIni", dateTimePicker1.Value);
            OFResumen1.SetParameterValue("DataFi", dateTimePicker2.Value);
            MecRobGest.GUI.GUIOFStatsrpt f = new MecRobGest.GUI.GUIOFStatsrpt();
            f.crystalReportViewer1.ReportSource = OFResumen1;
            f.MdiParent = this.Parent.FindForm();
            f.Show();
        }

        private void button6_Click(object sender, EventArgs e)
        {
            Reports.OFResumenAlb OFResumen1 = new Reports.OFResumenAlb();
            OFResumen1.SetParameterValue("DataIni", dateTimePicker1.Value);
            OFResumen1.SetParameterValue("DataFi", dateTimePicker2.Value);
            MecRobGest.GUI.GUIOFStatsrpt f = new MecRobGest.GUI.GUIOFStatsrpt();
            f.crystalReportViewer1.ReportSource = OFResumen1;
            f.MdiParent = this.Parent.FindForm();
            f.Show();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            Reports.OFResumenFact OFResumen1 = new Reports.OFResumenFact();
            OFResumen1.SetParameterValue("DataIni", dateTimePicker1.Value);
            OFResumen1.SetParameterValue("DataFi", dateTimePicker2.Value);
            MecRobGest.GUI.GUIOFStatsrpt f = new MecRobGest.GUI.GUIOFStatsrpt();
            f.crystalReportViewer1.ReportSource = OFResumen1;
            f.MdiParent = this.Parent.FindForm();
            f.Show();
        }

        private void button5_Click(object sender, EventArgs e)
        {
            Reports.OFResumenNoFact OFResumen1 = new Reports.OFResumenNoFact();
            OFResumen1.SetParameterValue("DataIni", dateTimePicker1.Value);
            OFResumen1.SetParameterValue("DataFi", dateTimePicker2.Value);
            MecRobGest.GUI.GUIOFStatsrpt f = new MecRobGest.GUI.GUIOFStatsrpt();
            f.crystalReportViewer1.ReportSource = OFResumen1;
            f.MdiParent = this.Parent.FindForm();
            f.Show();
        }

        private void clientsBindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            this.Validate();
            this.clientsBindingSource.EndEdit();
            this.clientsTableAdapter.Update(this.dBDataset.Clients);

        }

        private void GUIOFStats_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'dBDataset.Clients' table. You can move, or remove it, as needed.
            this.clientsTableAdapter.Fill(this.dBDataset.Clients);
            // TODO: This line of code loads data into the 'dBDataset.Clients' table. You can move, or remove it, as needed.
            this.clientsTableAdapter.Fill(this.dBDataset.Clients);

        }

        private void button3_Click(object sender, EventArgs e)
        {
            Reports.OFResumenFactCliente OFResumen1 = new Reports.OFResumenFactCliente();
            OFResumen1.SetParameterValue("DataIni", dateTimePicker1.Value);
            OFResumen1.SetParameterValue("DataFi", dateTimePicker2.Value);
            OFResumen1.SetParameterValue("Cliente", (string)comboBox1.SelectedValue);
            MecRobGest.GUI.GUIOFStatsrpt f = new MecRobGest.GUI.GUIOFStatsrpt();
            f.crystalReportViewer1.ReportSource = OFResumen1;
            f.MdiParent = this.Parent.FindForm();
            f.Show();
        }

        private void button7_Click(object sender, EventArgs e)
        {
            Reports.FacturasByClient OFResumen1 = new Reports.FacturasByClient();
            OFResumen1.SetParameterValue("DataIni", dateTimePicker1.Value);
            OFResumen1.SetParameterValue("DataFi", dateTimePicker2.Value);
            MecRobGest.GUI.GUIOFStatsrpt f = new MecRobGest.GUI.GUIOFStatsrpt();
            f.crystalReportViewer1.ReportSource = OFResumen1;
            f.MdiParent = this.Parent.FindForm();
            f.Show();
        }
    }
}